package code.whmmm.util.spring.boot;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * <br/><br/>
 * 创建时间: 2020/1/18 15:14
 *
 * @author whmmm
 */
@Component
public class UtilAppRunner implements ApplicationRunner {

    private static final Logger logger = LoggerFactory.getLogger(UtilAppRunner.class);

    @Override
    public void run(ApplicationArguments args) throws Exception {
        this.logBanner();
    }

    /**
     * 打印出 banner
     */
    public void logBanner() {
        logger.info("\n  _____ ______   ____  ____  ______  __ \n" +
                " / ___/|      | /    ||    \\|      ||  |\n" +
                "(   \\_ |      ||  o  ||  D  )      ||  |\n" +
                " \\__  ||_|  |_||     ||    /|_|  |_||__|\n" +
                " /  \\ |  |  |  |  _  ||    \\  |  |   __ \n" +
                " \\    |  |  |  |  |  ||  .  \\ |  |  |  |\n" +
                "  \\___|  |__|  |__|__||__|\\_| |__|  |__|\n" +
                "                                        ");
    }
}
